home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4857 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: newshost.lanl.gov!tanmoy
  2. From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: simple code, argc, argv, strcmp()
  5. Date: 06 Feb 1996 22:31:34 GMT
  6. Organization: Los Alamos National Laboratory
  7. Message-ID: <TANMOY.96Feb6153134@qcd.lanl.gov>
  8. References: <11f7cc$17261a.3b3@daprez> <4etj7c$bma@news.iag.net>
  9.     <fcusack-0202961621470001@mudskipper.cac.psu.edu>
  10.     <31177C77.167EB0E7@texas.net>
  11. NNTP-Posting-Host: qcd.lanl.gov
  12. Mime-Version: 1.0
  13. Content-Type: text
  14. In-reply-to: Michael Douglass's message of Tue, 06 Feb 1996 10:06:15 -0600
  15.  
  16. In article <31177C77.167EB0E7@texas.net> Michael Douglass
  17. <mikedoug@texas.net> writes: 
  18. <snip>
  19.    > > >  if (!strcmp(argv[1],"-d") || !strcmp(argv[1],"-e")) {
  20.    > > >    Usage();
  21.    > > >  }
  22.    > > <snip>
  23.  
  24.    > argv[1] is always guaranteed to exist. It is simply NULL if there were no
  25.    > arguments.
  26.  
  27.    Even if this is so... You still do *not* want to call strcmp with a
  28. NULL pointer 
  29.  
  30. Grammatical error :-) Even if this `were' so. argc can be zero with
  31. argv[0] being NULL and argv[1] undefined. This means that even the
  32. `program name' is not provided.
  33.  
  34. Cheers
  35. Tanmoy
  36. --
  37. tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
  38. Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
  39. Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
  40. <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
  41. internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
  42. fax: 1 (505) 665 3003   voice: 1 (505) 665 4733    [ Home: 1 (505) 662 5596 ]
  43.